# from django.test import TestCase
#
# # Create your tests here.
#
#
# x = {
#     'name': "rymmx",
#     'age': "26"
# }
#
# x['gender'] = 'man'
#
# sorted(x)
# print(x)
#
# print(x.get('nam'))
# print(x['name'])
#
#
# ###############################################
# # 将以下 3 个函数按照执行效率高低排序
#
# import random
# import cProfile  # cProfile  分析自己代码的性能,Python中有一个很好的程序分析包，可以满足这个需求。
#
#
# def f1(lIn):
#     l1 = sorted(lIn)
#     l2 = [i for i in l1 if i<0.5]
#     return [i*i for i in l2]
#
#
# def f2(lIn):
#     l1 = [i for i in lIn if i<0.5]
#     l2 = sorted(l1)
#     return [i*i for i in l2]
#
#
# def f3(lIn):
#     l1 = [i*i for i in lIn]
#     l2 = sorted(l1)
#     return [i for i in l1 if i<(0.5*0.5)]
#
#
# lIn = [random.random() for i in range(100000)]
#
# cProfile.run('f1(lIn)')
# cProfile.run('f2(lIn)')
# cProfile.run('f3(lIn)')
#
# """
# 结果:
# 7 function calls in 0.134 seconds
#
#    Ordered by: standard name
#
#    ncalls  tottime  percall  cumtime  percall filename:lineno(function)
#         1    0.004    0.004    0.134    0.134 <string>:1(<module>)
#         1    0.000    0.000    0.130    0.130 tests.py:20(f1)
#         1    0.016    0.016    0.016    0.016 tests.py:22(<listcomp>)
#         1    0.014    0.014    0.014    0.014 tests.py:23(<listcomp>)
#         1    0.000    0.000    0.134    0.134 {built-in method builtins.exec}
#         1    0.100    0.100    0.100    0.100 {built-in method builtins.sorted}
#         1    0.000    0.000    0.000    0.000 {method 'disable' of '_lsprof.Profiler' objects}
#
#
#          7 function calls in 0.045 seconds
#
#    Ordered by: standard name
#
#    ncalls  tottime  percall  cumtime  percall filename:lineno(function)
#         1    0.001    0.001    0.044    0.044 <string>:1(<module>)
#         1    0.000    0.000    0.043    0.043 tests.py:26(f2)
#         1    0.009    0.009    0.009    0.009 tests.py:27(<listcomp>)
#         1    0.007    0.007    0.007    0.007 tests.py:29(<listcomp>)
#         1    0.000    0.000    0.045    0.045 {built-in method builtins.exec}
#         1    0.027    0.027    0.027    0.027 {built-in method builtins.sorted}
#         1    0.000    0.000    0.000    0.000 {method 'disable' of '_lsprof.Profiler' objects}
#
#
#          7 function calls in 0.072 seconds
#
#    Ordered by: standard name
#
#    ncalls  tottime  percall  cumtime  percall filename:lineno(function)
#         1    0.002    0.002    0.072    0.072 <string>:1(<module>)
#         1    0.000    0.000    0.070    0.070 tests.py:32(f3)
#         1    0.007    0.007    0.007    0.007 tests.py:33(<listcomp>)
#         1    0.005    0.005    0.005    0.005 tests.py:35(<listcomp>)
#         1    0.000    0.000    0.072    0.072 {built-in method builtins.exec}
#         1    0.057    0.057    0.057    0.057 {built-in method builtins.sorted}
#         1    0.000    0.000    0.000    0.000 {method 'disable' of '_lsprof.Profiler' objects}
#
#
#
# """

#####################   元组,字典,集合   #############
# tuple_1 = (0,1,2)
# print(tuple_1)
# print("元组解包: ", *tuple_1)
#
# dict_1 = {
#     "name":"rymmx",
#     "age":"26"
# }
# print(dict_1)
# print({**dict_1})
#
#
# set_1 ={0,1,2,3,3,3,4,4,4,5}
# set_2 = {7,7,8,9,0}
# print(set_1)
# print(set_1^set_2)

# x=y=z=1
# print(x,y,z)